<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model common\models\Link */
/* @var $form yii\widgets\ActiveForm */

//$this->registerJs($this->render('js/upload.js'));
?>

<div class="link-form create_box">

    <?php $form = ActiveForm::begin(['options' => ['class' => 'layui-form']]); ?>

    <?= $form->field($model, 'site_url')->textInput(['maxlength' => true,'class'=>'layui-input']) ?>

    <?= $form->field($model, 'site_name')->textInput(['maxlength' => true,'class'=>'layui-input']) ?>
    <?= $form->field($model, 'site_content')->textInput(['maxlength' => true,'class'=>'layui-input']) ?>
    <?= $form->field($model, 'site_motto')->textInput(['maxlength' => true,'class'=>'layui-input']) ?>

    <?= $form->field($model, 'site_img',['template' => '{label} <div class="row"><div class="col-sm-12">{input}<button type="button" class="layui-btn upload_button" id="test3"><i class="layui-icon"></i>上传文件</button>{error}{hint}</div></div>'])->textInput(['maxlength' => true,'class'=>'layui-input upload_input']) ?>

    <?= Html::img(@$model->site_img, ['width'=>'50','height'=>'50','class'=>'layui-circle userinfo_head_pic'])?>

    <?= $form->field($model, 'sort')->textInput(['maxlength' => true,'class'=>'layui-input']) ?>

    <?= $form->field($model, 'created_at')->textInput(['maxlength' => true,'class'=>'layui-input']) ?>

    <div align='center'>
        <?= Html::submitButton($model->isNewRecord ? '添加' : '修改', ['class' => $model->isNewRecord ? 'layui-btn' : 'layui-btn layui-btn-normal']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>

